﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Media;
using websoniBO;

namespace websoni
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        Viewer v = new Viewer();
        Liner l = new Liner();
        protected void Page_Load(object sender, EventArgs e)
        {
            SoundPlayer s = new SoundPlayer("D:/IAST/websoni/websoni/music/Kal ho sad.wav");
            s.PlayLooping();
            s.Stop();
            long counts = new long();
            DataTable dt = l.GetRecords(-99, "", false, " and ");
            DataTable dt1=v.GetRecords(-99,-99,false," and ");
            if (!IsPostBack)
            {
                counts = Convert.ToInt64(dt1.Rows[0]["vcount"].ToString());
                Label2.Text =Convert.ToInt64(counts + 1).ToString();
                v.viid = Convert.ToInt64(dt1.Rows[0]["viid"].ToString());
                v.vcount = Convert.ToInt64(Label2.Text);
                v.isdeleted = false;
                v.SaveRecords();
                Label1.Text = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Label1.Text += dt.Rows[i]["liners"].ToString() + "<br /><br />";

                }
            }
        }
    }
}
